package com.ly.heart.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ly.heart.domain.*;
import com.ly.heart.domain.dto.ContractOrderMaterialDetailDto;
import com.ly.heart.domain.vo.ContractOrderMaterialDetailVo;

/**
 * 采购合同;1:采购;2:行政;Mapper接口
 * @author wutao
 * @date 2024-05-31
 */
public interface ContractProcureMapper extends BaseMapper<ContractProcureEntity> {
    /**
     * 查询采购合同;1:采购;2:行政;
     * @param id 采购合同;1:采购;2:行政;ID
     * @return 采购合同;1:采购;2:行政;
     */
    ContractProcureEntity selectContractProcureEntityById (String id);

    /**
     * 查询采购合同;1:采购;2:行政;列表
     * @param contractProcureEntity 采购合同;1:采购;2:行政;
     * @return 采购合同;1:采购;2:行政;集合
     */
    List<ContractProcureEntity> selectContractProcureEntityList (ContractProcureEntity contractProcureEntity);

    Integer queryCount (ContractProcureEntity contractProcureEntity);

    /**
     * 新增采购合同;1:采购;2:行政;
     * @param contractProcureEntity 采购合同;1:采购;2:行政;
     * @return 结果
     */
    int insertContractProcureEntity (ContractProcureEntity contractProcureEntity);

    /**
     * 修改采购合同;1:采购;2:行政;
     * @param contractProcureEntity 采购合同;1:采购;2:行政;
     * @return 结果
     */
    int updateContractProcureEntity (ContractProcureEntity contractProcureEntity);

    /**
     * 删除采购合同;1:采购;2:行政;
     * @param id 采购合同;1:采购;2:行政;ID
     * @return 结果
     */
    int deleteContractProcureEntityById (String id);

    /**
     * 批量删除采购合同;1:采购;2:行政;
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    int deleteContractProcureEntityByIds (String[] ids);

    /**
     * 根据采购合同对象List查询物料明细
     * 查询关联关系表，根据：
     * @param contractOrderMaterialDetailDto：采购合同明细=5
     * @return
     */
    List<ContractOrderMaterialDetailVo> queryMaterial (ContractOrderMaterialDetailDto contractOrderMaterialDetailDto);

    Integer queryMaterialCount (ContractOrderMaterialDetailDto contractOrderMaterialDetailDto);

    /**
     * 根据合同Id查询订单列表
     * @param contractOrderEntity
     * @return
     */
    List<OrderEntity> queryOrderByContract (ContractOrderEntity contractOrderEntity);

    /**
     * 根据合同Id查询物料列表
     * @param materialDetailEntity
     * @return
     */
    List<MaterialDetailEntity> queryMaterialByContract (MaterialDetailEntity materialDetailEntity);

}
